package com.crcc.common.exception;


import com.crcc.common.constant.CommonConsts;

public enum ExceptionEnum implements BaseResultInfoInterface {
    // 数据操作错误定义
    SUCCESS(CommonConsts.SUCCESS, "成功!"),
    TOKEN_NOT_EXIT(CommonConsts.TOKEN_NOT_EXIT, "token不存在 请重新登陆!"),
    TOKEN_OUT(CommonConsts.TOKEN_NOT_EXIT, "该用户在其他设备登录!"),
    BODY_NOT_MATCH(CommonConsts.BODY_NOT_MATCH,"请求的数据错误!"),
    INTERNAL_SERVER_ERROR(CommonConsts.INTERNAL_SERVER_ERROR, "服务器内部错误!"),
    INTERNAL_SERVER_ERRORNEW(CommonConsts.INTERNAL_SERVER_ERROR, "网络异常，请重试！"),
    USER_ERROR(CommonConsts.USER_ERROR, "用户不存在!"),
    DECRYPTION_FAILED(CommonConsts.DECRYPTION_FAILED, "解密失败!"),
    OPERATE_FAILED(CommonConsts.OPERATE_FAILED, "操作失败!"),
    ;

    /**
     * 错误码
     */
    private final String resultCode;

    /**
     * 错误描述
     */
    private final String resultMsg;

    ExceptionEnum(String resultCode, String resultMsg) {
        this.resultCode = resultCode;
        this.resultMsg = resultMsg;
    }

    @Override
    public String getResultCode() {
        return resultCode;
    }

    @Override
    public String getResultMsg() {
        return resultMsg;
    }

}
